<!DOCTYPE html>
<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org"  xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div th:fragment="includeJs">
        <link rel="stylesheet" th:href="@{/css/owl.carousel.css}"/>
        <link rel="shortcut icon" href="/favicon.ico"/>
        <link rel="bookmark" href="/favicon.ico"/>
        <link type="text/css" rel="stylesheet" th:href="@{/css/index.css}">
        <script type="text/javascript" th:src="@{/js/account/jquery-1.11.1.min.js}"></script>
        <script type="text/javascript" th:src="@{/js/account/superslide.2.1.js}"></script>
        <script type="text/javascript" th:src="@{/js/account/my.js}"></script>
        <script type="text/javascript" th:src="@{/js/account/mytz.js}"></script>
    </div>

    <div th:fragment="layui_js">
        <link rel="stylesheet" th:href="@{/layui/css/layui.css}"/>
        <script th:src="@{/layui/layui.js}"></script>
        <script th:src="@{/layui/lay/modules/layedit.js}" ></script>
        <script th:src="@{/js/echarts/echarts.min.js}"></script>
        <script th:src="@{/js/jquery/jquery.min.js}"></script>
        <script th:src="@{/js/jquery/jquery.cookie.js}"></script>
    </div>

    <div th:fragment="bootstrap_js">
    <link rel="stylesheet" th:href="@{/vendors/mdi/css/materialdesignicons.min.css}">
    <link rel="stylesheet" th:href="@{/vendors/css/vendor.bundle.base.css}">
    <link rel="stylesheet" th:href="@{/css/style.css}">
    <!--<link rel="stylesheet" th:href="@{/css/bootstrap.css}">-->
    <link rel="stylesheet" href="https://cdn.bootcss.com/jquery.bootstrapvalidator/0.5.3/css/bootstrapValidator.min.css"/>
    <link rel="shortcut icon" th:href="@{/images/favicon.png}" />
    <script th:src="@{/vendors/js/vendor.bundle.base.js}"></script>
    <script th:src="@{/vendors/chart.js/Chart.min.js}"></script>
    <script th:src="@{/js/off-canvas.js}"></script>
    <script th:src="@{/js/hoverable-collapse.js}"></script>
    <script th:src="@{/js/template.js}"></script>
    <script th:src="@{/js/dashboard.js}"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery.bootstrapvalidator/0.5.3/js/bootstrapValidator.js"></script>
</div>

    <div th:fragment="dingding_header" class="header">
        <div class="heaer_con">
            <ul sec:authorize="!isAuthenticated()">
                <li><a th:href="@{/register}">注册</a></li>
                <li><div class="header_rightLine"></div></li>
                <li><a th:href="@{/login}">登录</a></li>
            </ul>
            <ul sec:authorize="isAuthenticated()">
                <li><a th:href="@{/userInfo}" id="userName"></a></li>
                <li><div class="header_rightLine"></div></li>
                <li><a th:href="@{/logout}">退出登录</a></li>
            </ul>
        </div>
        <script sec:authorize="isAuthenticated()">
            window.onload = function () {
                $.post("/getUserName",{},function (data) {
                    $("#userName").text(data);
                },"text")
            }
        </script>
    </div>

    <div th:fragment="dingding_nav" class="nav">
        <div class="nav_logo"><img style="width: 245px;margin-top: -10px;" th:src="@{/img/new-logo.png}"></div>
        <ul class="nav_navs">
            <a th:href="@{/index}"><li>首  页</li></a>
            <a th:href="@{/newGuider}"><li>新手引导</li></a>
            <a th:href="@{/specimens/toMytz}"><li>我要投资</li></a>
            <a href="#" onclick="judgeCertification()"><li>我要借款</li></a>
            <a th:href="@{/userInfo}"><li>我的帐户</li></a>
        </ul>
        <script th:include="::judge"></script>
    </div>

    <script th:fragment="judge">
        function judgeCertification() {
            $.post("/loan/judgeUser",{},function (data) {
                if(data=='0'){
                    alert('请填写个人信息后再进行借贷业务。')
                    window.location.href="/userSet";
                }else {
                    window.location.href="/loan/main";
                }
            },"text")
        }
    </script>

    <nav th:fragment="admin_leftNav" style="background-color:#0b364f;" class="sidebar sidebar-offcanvas" id="sidebar">
        <ul class="nav">
            <li class="nav-item">
                <a class="nav-link" th:href="@{/admin/index}">
                    <i class="mdi mdi-view-quilt menu-icon"></i>
                    <span class="menu-title">首页</span>
                </a>
            </li>
            <div ><!--sec:authorize="hasRole('online')"-->
            <li class="nav-item sidebar-category">
                <p>叮叮在线</p>
                <span></span>
            </li>
            <li  class="nav-item">
            </li>
            <li  class="nav-item">
                <a class="nav-link" th:href="@{/specimens/tospecimensList}">
                    <i class="mdi mdi-database menu-icon"></i>
                    <span class="menu-title">放标</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/specimens/totzList}">
                    <i class="mdi mdi-coin menu-icon"></i>
                    <span class="menu-title">投资</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/admin/advert}">
                    <i class="mdi mdi-comment-processing-outline menu-icon"></i>
                    <span class="menu-title">广告</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/admin/toCouponManage}">
                    <i class="mdi mdi-credit-card menu-icon"></i>
                    <span class="menu-title">优惠券管理</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/admin/toGoods}">
                    <i class="mdi mdi-view-grid menu-icon"></i>
                    <span class="menu-title">商品管理</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/admin/toOrderManage}">
                    <i class="mdi mdi-check-circle menu-icon"></i>
                    <span class="menu-title">订单管理</span>
                </a>
            </li>
            </div>
            <div ><!--sec:authorize="hasRole('pratt')"-->
            <li class="nav-item sidebar-category">
                <p>叮叮普惠</p>
                <span></span>
            </li>
            <li  class="nav-item">
                <a class="nav-link" th:href="@{/admin/audit}">
                    <i class="mdi mdi-view-headline menu-icon"></i>
                    <span class="menu-title">借贷审核</span>
                </a>
            </li>
            <!--<li  class="nav-item">&lt;!&ndash;sec:authorize="hasRole('pratt')"&ndash;&gt;
                <a class="nav-link"  th:href="@{/admin/debit}">
                    <i class="mdi mdi-account menu-icon"></i>
                    <span class="menu-title">借贷管理</span>
                </a>
            </li>-->
            <li class="nav-item">
                <a class="nav-link" th:href="@{/admin/interset}">
                    <i class="mdi mdi-chart-pie menu-icon"></i>
                    <span class="menu-title">利率管理</span>
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" th:href="@{/due/toDueList}">
                    <i class="mdi mdi-account menu-icon"></i>
                    <span class="menu-title">逾期列表</span>
                </a>
            </li>
            </div>
        </ul>
    </nav>

    <nav th:fragment="admin_nav" style="height: 110px;" class="navbar col-lg-12 col-12 px-0 py-0 py-lg-4 d-flex flex-row">
    <div class="navbar-menu-wrapper d-flex align-items-center justify-content-end">
        <button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize">
            <span class="mdi mdi-menu"></span>
        </button>
        <div class="navbar-brand-wrapper">
            <a class="navbar-brand brand-logo"><img th:src="@{/images/logo.svg}" alt="logo"/></a>
        </div>
        <h4 class="font-weight-bold mb-0 d-none d-md-block mt-1">欢迎来到叮叮后台管理</h4>
        <ul class="navbar-nav navbar-nav-right">
            <li class="nav-item dropdown mr-1">
                <a style="cursor: pointer;" class="nav-link count-indicator dropdown-toggle d-flex justify-content-center align-items-center" id="messageDropdown" data-toggle="dropdown">
                   <!-- <span th:text="${cookie.getValue()}"></span>--><!--sec:authentication="principal.getUsername()"-->
                    <span th:each="cookie :${#httpServletRequest.getCookies()}"
                          th:if="${cookie.getName().equals('key')}"
                          th:text="${cookie.getValue()}">
                    </span>
                    <i class="mdi mdi-arrow-down-drop-circle-outline"></i>
                </a>
                <div class="dropdown-menu dropdown-menu-right navbar-dropdown preview-list" aria-labelledby="messageDropdown">
                    <a class="dropdown-item">
                        <i class="mdi mdi-settings text-primary"></i>
                        设置
                    </a>
                    <a class="dropdown-item" th:href="@{/admin/logout}">
                        <i class="mdi mdi-logout text-primary"></i>
                        注销
                    </a>
                </div>
            </li>
        </ul>
        <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button" data-toggle="offcanvas">
            <span class="mdi mdi-menu"></span>
        </button>
    </div>
</nav>

    <!--个人中心的菜单栏-->
    <div th:fragment="userInfoMenu" id="personal-left" class="personal-left">
        <ul>
            <li id="userInfo">
                <span>
                    <a class="user-info-item" th:href="@{/userInfo}">账户总览</a>
                </span>
            </li>
            <li id="userSet">
                <span>
                    <a class="user-info-item" th:href="@{/userSet}">账户设置</a>
                </span>
            </li>
            <li id="depositsHistory">
                <span>
                    <a class="user-info-item" th:href="@{/depositsHistory}">投资记录</a>
                </span>
            </li>
            <li id="loanHistory">
                <span>
                    <a class="user-info-item" th:href="@{/loanHistory}">借贷记录</a>
                </span>
            </li>
            <li id="bankSet">
                <span>
                    <a class="user-info-item" th:href="@{/bankSet}">银行卡管理</a>
                </span>
            </li>
            <li id="recharge">
                <span>
                    <a class="user-info-item" th:href="@{/recharge}">充值</a>
                </span>
            </li>
            <li id="withdraw">
                <span>
                    <a class="user-info-item" th:href="@{/withdraw}">提现</a>
                </span>
            </li>
            <li id="myCoupon">
                <span>
                    <a class="user-info-item" th:href="@{/myCoupon}">我的优惠券</a>
                </span>
            </li>
            <li id="changeHistory">
                <span>
                    <a class="user-info-item" th:href="@{/changeHistory}">兑换历史</a>
                </span>
            </li>
            <li id="order">
                <span>
                    <a class="user-info-item" th:href="@{/order}">我的订单</a>
                </span>
            </li>
            <li id="myAddress">
                <span>
                    <a class="user-info-item" th:href="@{/myAddress}">我的地址</a>
                </span>
            </li>
        </ul>
    </div>

    <!--个人中心的js-->
    <script th:fragment="userInfoJS">
        let pathname = window.document.location.pathname;

        if ("/userInfo" == pathname) {
            $("#userInfo").addClass("pleft-cur");
        } else if ("/recharge" == pathname) {
            $("#recharge").addClass("pleft-cur");
        } else if ("/changeHistory" == pathname) {
            $("#changeHistory").addClass("pleft-cur");
        } else if ("/cashTransfer" == pathname) {
            $("#cashTransfer").addClass("pleft-cur");
        } else if ("/loanHistory" == pathname) {
            $("#loanHistory").addClass("pleft-cur");
        } else if ("/withdraw" == pathname) {
            $("#withdraw").addClass("pleft-cur");
        } else if ("/userSet" == pathname) {
            $("#userSet").addClass("pleft-cur");
        } else if ("/myCoupon" == pathname) {
            $("#myCoupon").addClass("pleft-cur");
        } else if ("/depositsHistory" == pathname) {
            $("#depositsHistory").addClass("pleft-cur");
        } else if ("/bankSet" == pathname) {
            $("#bankSet").addClass("pleft-cur");
        } else if ("/order" == pathname) {
            $("#order").addClass("pleft-cur");
        } else if ("/myAddress" == pathname) {
            $("#myAddress").addClass("pleft-cur");
        }


    </script>
</body>
</html>